const express = require('express');
const bodyParser = require('body-parser');
const userHandle = require('../router-handle/user_handle.js');

//解析json
const mw_jsonParser = bodyParser.json();
//解析表单
const mw_urlencodedParser = bodyParser.urlencoded({ extended: false });

//创建路由对象
const router = express.Router();
router.get("/users", userHandle.getUsers);
// router.post("/register", mw_jsonParser, userHandle.register);
router.post("/register", mw_urlencodedParser, userHandle.register);
module.exports = router;

